# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1OsUpdateStatus do
  @moduledoc """
  Contains information regarding the current OS update status. * This field is telemetry information and this will change over time as the device is utilized. * Data for this field is controlled via policy: [ReportDeviceOsUpdateStatus](https://chromeenterprise.google/policies/#ReportDeviceOsUpdateStatus) * Data Collection Frequency: Only at Upload * Default Data Reporting Frequency: 3 hours - Policy Controlled: Yes * Cache: If the device is offline, the collected data is stored locally, and will be reported when the device is next online: No * Reported for affiliated users only: N/A * Granular permission needed: TELEMETRY_API_OS_REPORT

  ## Attributes

  *   `lastRebootTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of the last reboot.
  *   `lastUpdateCheckTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of the last update check.
  *   `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of the last successful update.
  *   `newPlatformVersion` (*type:* `String.t`, *default:* `nil`) - Output only. New platform version of the os image being downloaded and applied. It is only set when update status is OS_IMAGE_DOWNLOAD_IN_PROGRESS or OS_UPDATE_NEED_REBOOT. Note this could be a dummy "0.0.0.0" for OS_UPDATE_NEED_REBOOT status for some edge cases, e.g. update engine is restarted without a reboot.
  *   `newRequestedPlatformVersion` (*type:* `String.t`, *default:* `nil`) - Output only. New requested platform version from the pending updated kiosk app.
  *   `updateState` (*type:* `String.t`, *default:* `nil`) - Output only. Current state of the os update.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :lastRebootTime => DateTime.t() | nil,
          :lastUpdateCheckTime => DateTime.t() | nil,
          :lastUpdateTime => DateTime.t() | nil,
          :newPlatformVersion => String.t() | nil,
          :newRequestedPlatformVersion => String.t() | nil,
          :updateState => String.t() | nil
        }

  field(:lastRebootTime, as: DateTime)
  field(:lastUpdateCheckTime, as: DateTime)
  field(:lastUpdateTime, as: DateTime)
  field(:newPlatformVersion)
  field(:newRequestedPlatformVersion)
  field(:updateState)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1OsUpdateStatus do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1OsUpdateStatus.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1OsUpdateStatus do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
